package cn.green.exceptions.busi;

import cn.green.annotations.busi.Function;

import java.lang.reflect.Method;

public class NotControllerException extends RuntimeException {

    protected Function function;

    protected String name;

    public NotControllerException(Method method) {
        Function declaredAnnotation = method.getDeclaredAnnotation(Function.class);
        if (declaredAnnotation != null) {
            name = declaredAnnotation.name();
        } else {
            name = method.getName();
        }
    }

    @Override
    public String getMessage() {
        //todo 返回信息-待开发
        return name + "";
    }
}
